package cn.zzdt4j.discovery.core;

import cn.zzdt4j.common.model.InstanceInfo;

import java.util.List;

/**
 * The interface Instance registry.
 *
 * @param <T> the type parameter
 * @author by <a href="mailto:ligang941012@gmail.com">gang.Li</a>
 * @since 2023 /11/12 22:07
 */
public interface InstanceRegistry<T> {

    /**
     * List instance list.
     *
     * @param appName the app name
     * @return the list
     */
    List<Lease<T>> listInstance(String appName);

    /**
     * Register.
     *
     * @param info the info
     */
    void register(T info);

    /**
     * Renew boolean.
     *
     * @param instanceRenew the instance renew
     * @return the boolean
     */
    boolean renew(InstanceInfo.InstanceRenew instanceRenew);

    /**
     * Remove.
     *
     * @param info the info
     */
    void remove(T info);
}
